package com.nf.bookstytem.web.readermanage;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.nf.bookstytem.model.readermanage.ReaderModel;
import com.nf.bookstytem.service.readermanage.ReaderManageService;
import com.nf.bookstytem.uitl.JsonUtil;
@WebServlet("/readermanage/update")
public class ReaderUpdateServlet extends HttpServlet{

	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		ReaderManageService service=new ReaderManageService();
		ReaderModel reader=JsonUtil.fromJson(req.getInputStream(), ReaderModel.class);
		Object result =service.updateReader(reader);
		resp.setContentType("application/json;charset=UTF-8");
		resp.getWriter().print(result);
		
	}
	
}
